using System;
using System.Xml.Serialization;

namespace com.exceptionalsoftware.spacetime.KML
{
	[Serializable()]
    [XmlType(TypeName = "ObjectType")]
    [XmlInclude(typeof(Feature))]
    [XmlInclude(typeof(Container))]
    [XmlInclude(typeof(Document))]
    [XmlInclude(typeof(Folder))]
    [XmlInclude(typeof(Placemark))]
    [XmlInclude(typeof(NetworkLink))]
    [XmlInclude(typeof(Overlay))]
    [XmlInclude(typeof(GroundOverlay))]
    [XmlInclude(typeof(ScreenOverlay))]
    [XmlInclude(typeof(PhotoOverlay))]
    [XmlInclude(typeof(Geometry))]
    [XmlInclude(typeof(GeometryElementsGeometry))]
    [XmlInclude(typeof(Point))]
    [XmlInclude(typeof(LineString))]
    [XmlInclude(typeof(LinearRing))]
    [XmlInclude(typeof(Polygon))]
    [XmlInclude(typeof(MultiGeometry))]
    [XmlInclude(typeof(Model))]
    [XmlInclude(typeof(StyleSelector))]
    [XmlInclude(typeof(Style))]
    [XmlInclude(typeof(StyleMap))]
    [XmlInclude(typeof(ColorStyle))]
    [XmlInclude(typeof(LineStyle))]
    [XmlInclude(typeof(PolyStyle))]
    [XmlInclude(typeof(IconStyle))]
    [XmlInclude(typeof(IconStyleIcon))]
    [XmlInclude(typeof(LabelStyle))]
    [XmlInclude(typeof(BalloonStyle))]
    [XmlInclude(typeof(ListStyle))]
    [XmlInclude(typeof(LookAtType))]
    [XmlInclude(typeof(Camera))]
    [XmlInclude(typeof(Scale))]
    [XmlInclude(typeof(Orientation))]
    [XmlInclude(typeof(Location))]
    [XmlInclude(typeof(Link))]
    [XmlInclude(typeof(Icon))]
    [XmlInclude(typeof(TimePrimitive))]
    [XmlInclude(typeof(TimeSpan))]
    [XmlInclude(typeof(Region))]
    [XmlInclude(typeof(LevelOfDetail))]
    [XmlInclude(typeof(LatLonBox))]
    [XmlInclude(typeof(LatLonAltBox))]
    [XmlInclude(typeof(ViewVolume))]
    [XmlInclude(typeof(ResourceMap))]
    [XmlInclude(typeof(Alias))]
    [XmlInclude(typeof(ItemIcon))]
    [XmlInclude(typeof(DataType))]
    [XmlInclude(typeof(SchemaDataType))]
    public abstract class ObjectType
	{
        private string idField;
        private string targetIdField;

        public ObjectType()
        {
            // Do nothing.
        }

        public ObjectType(string id)
        {
            this.Id = id;
        }

        [XmlAttribute(AttributeName = "id", DataType = "ID")]
        public string Id
        {
            get { return this.idField; }
            set { this.idField = value; }
        }

        [XmlAttribute(AttributeName = "targetId", DataType = "NCName")]
        public string TargetId
        {
            get { return this.targetIdField; }
            set { this.targetIdField = value; }
        }
    }
}